(1) Field of the Invention
The present invention relates to a method and device for adjusting the transmission rate of a transport stream, and more particularly to a method and device for adjusting the transmission rate of a transport stream (MPEG-TS) that has been compression encoded in accordance with the MPEG (Moving Picture Experts Group) standard.
(2) Description of the Related Art
In recent years, devices have come into popular use for playing back MPEG files stored on a recording medium, such as a memory card. In this type of playback device, an MPEG decoder is used to serve as an interface for MPEG files in MPEG2-TS. Typically, data of various transmission rates are stored as MPEG files on a recording medium, and the MPEG2-TS that is read from the MPEG file has various transmission rates. As a result, the transmission rate of MPEG2-TS that is read from MPEG files sometimes differs from the transmission rate that is appropriate for the MPEG decoder. In such cases, the MPEG2-TS read from MPEG files must be converted to the transmission rate appropriate to the MPEG decoder.
Methods for supplying MPEG2-TS that has been read from an MPEG file at the transmission rate appropriate to an MPEG decoder include a method in which a PCR (Program Clock Reference), which is a program time standard reference value inscribed in TS packets, is used to reproduce a clock by a PLL circuit, and then transmits MPEG2-TS matched to the reproduced clock to a MPEG decoder.
In addition to the above-described method, JP-A-2001-339688 (hereinbelow referred to as Patent Document 1) discloses a playback device, the configuration and operation of which are described in greater detail below.
MPEG-TS enables the multiplexing of a plurality of programs such as video signals, audio signals, and data in a single stream. FIG. 1 shows the packet configuration of MPEG-TS.
MPEG-TS is made up from an assemblage of a plurality of transport packets (hereinbelow referred to as simply “TS packets”) having a packet length of 188 bytes as shown in (A) of FIG. 1. Each TS packet is composed of header 51 and payload 52, as shown in (B) of FIG. 1. Header 51 is composed of a transport header of 32 bits and adaptation field 54, as shown in (C) of FIG. 1. The transport header includes PID (Packet Identification) 53 of 13 bits, which is packet identification information. As shown in (D) of FIG. 1, adaptation field 54 includes PCR 55 of 48 bits, which is the program time standard reference value. PCR 55 is a time stamp of 27 MHz. This PCR 55 is consulted to reproduce the standard time during encoding by the STC (System Time Clock) of the MPEG decoder.
As shown in (E) of FIG. 1, PCR 55 is described by a total of 48 bits: extension portion 60 of 9 bits that repeats 300 counts, base portion 58 of 33 bits that counts one for the 300 counts of extension portion 60, and reserved region 59 of 6 bits. FIG. 2 shows the configuration of the transport stream playback device described in patent document 1. Referring to FIG. 2, the transport stream playback device is composed of: playback processor 102, memory 103, PCR detector 104, timing controller 105, PCR operation unit 106, NULL packet generation unit 107, and selector 108.
MPEG-TS is recorded on recording medium 100 at a recording rate different from the transmission rate of 27 Mbps. Playback processor 102 plays back the MPEG-TS from recording medium 100 and transfers this reproduced MPEG-TS to memory 103 and PCR detector 104. PCR detector 104 detects the PCR in the reproduced MPEG-TS and transmits the PCR detection signal to timing controller 105 for each detection of this PCR.
NULL packet generation unit 107 generates NULL packets, which are dummy TS packets. The packet length of these NULL packets is also 188 bytes, identical to that of the TS packets. MPEG-TS that has been read from memory 103 is supplied to one of the inputs of selector 108, and NULL packets generated in NULL packet generation unit 107 are supplied to the other input of selector 108. Selector 108 selects and supplies as output one of these inputs. PCR operation unit 106 calculates the value of the next PCR such that the proper PCR spacing is realized when the spacing of the current PCR and the next PCR exceeds the proper PCR spacing due to the insertion of NULL packets.
Timing controller 105 both monitors the detected PCR value of input PCR detection signals and supplies from selector 108 the playback MPEG-TS that has been read from memory 103 matched to 27 MHz clock. Timing controller 105 calculates the difference value between the current PCR and the next PCR, and based on the result of this calculation, determines how many bits of data can be transmitted at 27 MHz clock in the interval between the current PCR and the next PCR when supplying, at a transmission rate of 27 Mbps, MPEG-TS that has been read from memory 103. When a contradiction occurs in the PCR spacing during supply of the MPEG-TS packet that contains the next PCR, timing controller 105 does not read the MPEG-TS packet that contains the next PCR from memory 103, but rather, inserts a NULL packet generated in NULL packet generation unit 107 in its place. If the spacing between the current PCR and the next PCR exceeds the proper PCR spacing when timing controller 105 is to insert yet another NULL packet and then supply the MPEG-TS packet that contains the next PCR, timing controller 105 reads the TS packet that contains the next PCR from memory 103 without inserting the NULL packet. At this time, timing controller 105 rewrites the value of the next PCR that has been inscribed in the TS packet that has been read to a PCR value that has been calculated in PCR operation unit 106 to match the output timing. In this way, output MPEG-TS can be obtained that lacks mismatching between PCR.
However, the above-described playback method and playback device have the problems described below.
In the method in which PCR is used to reproduce a clock in a PLL circuit and MPEG2-TS is transmitted to an MPEG decoder matched to the reproduced clock, a clock reproduction circuit is required that uses a PLL circuit, and this method therefore has the drawbacks of increased circuit scale and high costs. In addition, when reproducing, in an MPEG decoder, data that have undergone software conversion from MPEG2-PS (Program Stream) to MPEG2-TS, the transmission rate that is calculated based on the number of bytes between the PCR of MPEG2-TS is sometimes not uniform, and as a result, clock reproduction that uses the above-described PLL circuit is problematic.
The reproduction device described in Patent Document 1 is a device that reproduces and supplies recording data (MPEG files) in which the transmission rate is 25 Mbps as MPEG-TS in which the transmission rate is 27 Mbps, and that uses a clock in which the frequency is 27 MHz to supply this reproduction MPEG-TS. The clock of 27 MHz for this output must match with the clock that is calculated from the PCR. As a result, the reproduction device described in Patent Document 1 also necessitates a clock reproduction circuit that uses a PLL circuit and thus entails the same drawbacks as described above.